#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <pwd.h>

int main(int argc, char *argv[])
{
	int retval;
	retval=system("ls -l");
	if(retval==127)
	{
	fprintf(stderr,"/bin/sh not arvilable\n");
	exit(127);
	}
	else if(retval==-1)
	{
		perror("system");
		exit(EXIT_FAILURE);
	}
	else if(retval!=0)
	{
		fprintf(stderr,"command returned %d",retval);
		perror("ls");
	}
	else
	{
		puts("command successfully executed");
	}
	exit(EXIT_SUCCESS);
}
